<?php

namespace Bundle\ModuleBundle\DataSource;

class DataSet implements \Iterator
{
	/**
	 * @var \ArrayIterator
	 */
	private $_iterator;
	
	private $_dataRows;
	
	public function __construct($data)
	{
	
		$this->_dataRows = array();
		foreach($data as $id => $item)
		{
			$this->_dataRows[$id] = new DataRow($item);
		}
		
		$this->_iterator = new \ArrayIterator($this->_dataRows);
	}
	
	public function current()
	{
		return $this->_iterator->current();
	}
	
	public function key()
	{
        return $this->_iterator->key();		
	}
	
	public function next()
	{
		$this->_iterator->next();
	}
	
	public function valid()
	{
		return $this->_iterator->valid();
	}
	
	public function rewind()
	{
		return $this->_iterator->rewind();
	}
	
	
}